<?php
header("Access-Control-Allow-Origin","*");
require './yonghuxq.php';


session_start();
$file = $_FILES["file"];

$pic = $_POST['pic'];                                       
$nicheng = $_POST['nicheng']; 
$sex = $_POST['sex']; 
$ziwoJS = $_POST['ziwoJS']; 
$yonghuID = $_POST['yonghuID'];			
								

             
$aa = new yonghuxq();
$path = $aa->setFile($file);

if($path=="9999"){
	echo "9999";    //文件已经上传过了
}         
else if($path == "10000"){
	echo "10000";    //文件上传失败
}
else{
	// $aa->insert();
	$ins = array(["nicheng"=>"$nicheng","sex"=>"$sex","ziwoJS"=>"$ziwoJS","imgTX"=>"$path","yonghuID"=>"$yonghuID"]);
	$aa->insert($ins);
}



?>